<?php
class Model_Nguoitimviec extends Model{
public $table="nguoitimviec";
 
public function insert_nguoitimviec($data){
	$this->insert($this->table,$data);
	return TRUE;
}

public function listnguoitimviec(){
	$this->order("id_ntv DESC");
	$this->getdata($this->table);
	return $this->fetchall();
}

public function delete_nguoitimviec($id){
	$this->where("id_ntv = '$id'");
	$this->delete($this->table);
}

public function getnguoitimviec($id){
	$this->where("id_ntv = '$id'");
	$this->getdata($this->table);
	return $this->fetchone();
}

public function update_nguoitimviec($data,$id){
		$this->where("id_ntv = '$id'");
		$this->update($this->table,$data);
		return TRUE;
}

public function delete_all($str){
	$this->where("id_ntv in ($str)");
	$this->delete($this->table);
}
public function listselect($str){
	$this->select("id_ntv, ten_ntv");
	$this->where("id_ntv in ($str)");
	$this->getdata($this->table);
	return $this->fetchall();
}

}